//
//  RightDetailViewCell.m
//  Daybook
//
//  Created by dllo on 16/5/28.
//  Copyright © 2016年 zhangbin. All rights reserved.
//

#import "RightDetailViewCell.h"
#import "Common.h"

@implementation RightDetailViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
        
        
    }
    return self;
}

- (void)createView {
    
//    self.contentView.backgroundColor = [UIColor greenColor];
    
    self.picImageView = [[UIImageView alloc]init];
    self.picImageView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.picImageView];
    
    self.nameLabel = [[UILabel alloc]init];
    self.nameLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.nameLabel];
    _nameLabel.font = [UIFont systemFontOfSize:19 / 414.0 * self.frame.size.width];
    
    self.moneyLabel = [[UILabel alloc]init];
    self.moneyLabel.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.moneyLabel];
    _moneyLabel.textAlignment = NSTextAlignmentRight;
    _moneyLabel.font = [UIFont systemFontOfSize:22 / 414.0 * self.frame.size.width weight:2];

    self.lineView = [[UIView alloc] init];
    [self.contentView addSubview:_lineView];
    _lineView.backgroundColor = LINE_COLOR;
}

- (void)layoutSubviews {
    self.picImageView.frame = CGRectMake(20 / 414.0 * MAIN_WIDTH, (MAIN_HEIGHT * (10 / 736.0)) , 40 / 414.0 * MAIN_WIDTH, 40 / 414.0 * MAIN_WIDTH);
    self.nameLabel.frame = CGRectMake(100 / 414.0 * MAIN_WIDTH, (MAIN_HEIGHT * (20 / 736.0)), 150 / 414.0 * MAIN_WIDTH, 20 / 414.0 * MAIN_WIDTH);

    
    self.moneyLabel.frame = CGRectMake(MAIN_WIDTH - 140 / 414.0 * MAIN_WIDTH, (MAIN_HEIGHT * (20 / 736.0)), 120 / 414.0 * MAIN_WIDTH, 20 / 414.0 * MAIN_WIDTH);
    
    _lineView.frame = CGRectMake(0, self.contentView.frame.size.height, MAIN_WIDTH, 1);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
